{% extends "layout.html" %}
{% block content %}
<div class="container">
    <h1>{{ resource.title }}</h1>
    <div class="my-4">
        {% if resource.type == 'text' %}
            <p>{{ resource.content | safe }}</p>
        {% elif resource.type == 'image' %}
            <img src="{{ resource.content }}" class="img-fluid" alt="Resource Image">
        {% elif resource.type == 'video' %}
            <video controls class="w-100">
                <source src="{{ resource.content }}" type="video/mp4">
                您的浏览器不支持视频播放。
            </video>
        {% endif %}
    </div>
    <a href="{{ url_for('resource_list') }}" class="btn btn-secondary">返回列表</a>
</div>
{% endblock %}
